
#ifndef __SKELDEFORMATION_H__
#define __SKELDEFORMATION_H__

#include "core/deformation.h"

using namespace std;

class SkelDeformation : public Deformation {
   
public:
   SkelDeformation() { }
   ~SkelDeformation() { }
   
   void setTarget(const vector<Point3> *dcpos) {
      d_constraintsPos = dcpos; // positions of deformed constraints 
   }
   
   void eval(int i, Point3 &p, Vector3 &QSTAR, Vector3 &U) {
      
      compute_pstar_points(i);
      compute_qstar_points(i);
      computeCorrelationMatrix_points(i);
      eigenvalue = computeLargestRootOfQuarticEquation() + traceM;
      
      //cout<<eigenvalue<<" :: "<<traceM<<endl;
      
      compute_u();
      
      // Apply the rotation on the vertex position
      computeRotation(&vhatList[i][0]);
      
      U = Vector3(u[0],u[1],u[2]);
      QSTAR = Vector3(qstar[0], qstar[1], qstar[2]);
      p = Point3(qstar[0]+rv[0], qstar[1]+rv[1], qstar[2]+rv[2]);
   }
};

#endif 
